﻿@model EmgrMvc.Models.OntimeJob

@{
    ViewData["Title"] = "Create";
}

<h2>Create</h2>

<h4>OntimeJob</h4>
<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="Create">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="Name" class="control-label"></label>
                <input asp-for="Name" class="form-control" />
                <span asp-validation-for="Name" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Weekday" class="control-label"></label>
                @*<input asp-for="Weekday" class="form-control" />*@
                <select asp-for="Weekday">
                    <option value="1">星期天</option>
                    <option value="2">星期一</option>
                    <option value="3">星期二</option>
                    <option value="4">星期三</option>
                    <option value="5">星期四</option>
                    <option value="6">星期五</option>
                    <option value="7">星期六</option>
                </select>
                <span asp-validation-for="Weekday" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Hour" class="control-label"></label>
                <input asp-for="Hour" value="8" class="form-control" />
                <span asp-validation-for="Hour" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Minute" class="control-label"></label>
                <input asp-for="Minute" value="0" class="form-control" />
                <span asp-validation-for="Minute" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Second" class="control-label"></label>
                <input asp-for="Second" value="0" class="form-control" />
                <span asp-validation-for="Second" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="OddEvenWeek" class="control-label"></label>
                @*<input asp-for="OddEvenWeek" class="form-control" />*@
            <select asp-for="OddEvenWeek">
                <option value="ODD">单周</option>
                <option value="EVEN">双周</option>
                <option value="BOTH">单双周</option>
            </select>
                <span asp-validation-for="OddEvenWeek" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="DeviceOrGroup" class="control-label"></label>
                @*<input asp-for="DeviceOrGroup" class="form-control" />*@
                <select asp-for="DeviceOrGroup" readonly>
                    <option value="DEVICE">设备</option>
                    <option value="GROUP">设备组</option>
                </select>

                <span asp-validation-for="DeviceOrGroup" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="DeviceOrGroupId" class="control-label"></label>
                <select asp-for="DeviceOrGroupId" asp-items="ViewBag.DeviceList" class="form-control">
                </select>
                <span asp-validation-for="DeviceOrGroupId" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Action" class="control-label"></label>
                @*<input asp-for="Action" class="form-control" />*@
                <select asp-for="Action">
                    <option value="ON">开机</option>
                    <option value="OFF">关机</option>
                </select>
                <span asp-validation-for="Action" class="text-danger"></span>
            </div>
            <div class="form-group">
                <div class="checkbox">
                    <label>
                        <input asp-for="Active" /> @Html.DisplayNameFor(model => model.Active)
                    </label>
                </div>
            </div>
            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>

